package com.liujun.spring4.demo.aop.iocset.beanConfig.configuration;

import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.dao.LogDao;
import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.dao.LogDaoImpl;
import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.dao.UserDao;
import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.dao.UserdaoImpl;
import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.service.LogonService;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;

/**
 * 进行全用java类提供的bean定义信息
 *
 * @author liujun
 * @version 1.0
 * @date 2018-08-20 11:00:00
 */
@Configurable
public class AppConf {


    @Bean
    public UserDao userDao()
    {
        return new UserdaoImpl();
    }

    @Bean
    public LogDao logDao()
    {
        return new LogDaoImpl();
    }

    @Bean
    public LogonService logonService()
    {
        LogonService logonService = new LogonService();

        logonService.setLogDao(logDao());
        logonService.setUserDao(userDao());

        return logonService;
    }



}
